import Logo1 from '@/assets/logo-1.png';
import Logo2 from '@/assets/logo-2.png';
import { initWXConfig, isWeixin, wxAuth } from '@/utils';
import { useEffect } from 'react';
import { Link, Outlet } from 'umi';

export default function Layout() {
  const openId = localStorage.getItem('openId');
  if (!openId && isWeixin()) return wxAuth();

  useEffect(() => {
    initWXConfig();
  }, []);

  return (
    <>
      <img
        src={Logo1}
        className="w-[154px] h-[32px]  absolute left-4 top-5 z-10"
      />

      <img
        src={Logo2}
        className="w-[184px] h-[58px] bg-cover absolute right-4 top-2 z-10"
      />

      <Link
        to="/debug"
        data-html2canvas-ignore
        className=" absolute right-0 top-0 text-white text-xs bg-black p-1 z-50"
      >
        进入调试
      </Link>
      <Outlet />
    </>
  );
}
